require('./PageHome.less');
import { Link, Control , Route } from 'react-keeper'

import { Page,Panel,Toast,PanelHeader,Flex,FlexItem } from 'react-weui/build/packages';



class MyHome extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      showToast: false,
      showLoading: false,
      toastTimer: null,
      loadingTimer: null,
      loadbt: {
        label: '查看更多',
        onClick: this.popbt.bind(this)
      },
    };
    this.showLoading = this.showLoading.bind(this);

  }

  render() {
    return (

      <div>
        <Toast icon="loading" show={this.state.showLoading}>Loading...</Toast>
        <Page className="myhome" infiniteLoader={false} ptr={false} >
        {this.props.children }
        </Page>
      </div>

    );
  }

  popbt() {

  }
  showLoading() {
    this.setState({showLoading: true});

    this.state.loadingTimer = setTimeout(()=> {
      this.setState({showLoading: false});
    }, 2000);
  }

  componentWillMount() {
    this.showLoading();
  }

  componentDidMount() {

  }

  componentWillReceiveProps(nextProps) {

  }


  shouldComponentUpdate(nextProps, nextState) {
    return true;
  }

  componentWillUpdate(nextProps, nextState) {

  }


  componentDidUpdate(prevProps, prevState) {

  }


  componentWillUnmount() {

  }

}

export default MyHome;
